home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Message Dialogs / confirm-alert.izs < prev    next >
Text File  |  2005-09-28  |  2KB  |  107 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Confirm (Alert)
  4.  
  5. <!/TITLE>
  6.  
  7. <!DESCRIPTION> Here is a JavaScript confirm message that has variable responses. Basically, the response they get depends on what the user enters.
  8. <!/DESCRIPTION> 
  9.  
  10. <!CATEGORY>Messages<!/CATEGORY>
  11.  
  12. <!SCRIPT>
  13. <!-- START OF SCRIPT -->
  14.  
  15.  
  16. <!-- HOW TO INSTALL CONFIRM (ALERT):
  17.  
  18.    1.  Paste the coding into the HEAD of your HTML document
  19.    2.  Put last coding into the BODY section of document  -->
  20.  
  21. <!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->
  22.  
  23. <HEAD>
  24.  
  25. <SCRIPT LANGUAGE="JavaScript">
  26.  
  27.  
  28.  
  29. <!--  Begin
  30. function askData() {
  31. var inputedData =  prompt ("type something!", "" );
  32. if (confirm("Are you sure you typed "+inputedData+"?")) {
  33. alert ("Ok, you did type "+inputedData+"!");
  34. }
  35. else {
  36. alert ("No, you did not type "+inputedData+", did you?  OK.  Guess ya did.");
  37.    }   
  38. }
  39. // End -->
  40. </SCRIPT>
  41.  
  42. <!-- STEP TWO: Put this code into the BODY of your HTML document  -->
  43.  
  44. <BODY>
  45.  
  46. <CENTER>
  47. <FORM>
  48. <input type=button value="Confirm (Alert)" onClick="askData()">
  49. </FORM>
  50. <!-- Or another method...  --><BR>Or....<BR>
  51. <A HREF="" onMouseover="askData()">Confirm & Alert</A>
  52. </CENTER>
  53.  
  54.  
  55.  
  56. <!-- END OF SCRIPT -->
  57. <!/SCRIPT>
  58.  
  59. <!PREVIEW>
  60. <!-- START OF SCRIPT -->
  61.  
  62.  
  63. <!-- HOW TO INSTALL CONFIRM (ALERT):
  64.  
  65.    1.  Paste the coding into the HEAD of your HTML document
  66.    2.  Put last coding into the BODY section of document  -->
  67.  
  68. <!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->
  69.  
  70. <HEAD>
  71.  
  72. <SCRIPT LANGUAGE="JavaScript">
  73.  
  74.  
  75.  
  76. <!--  Begin
  77. function askData() {
  78. var inputedData =  prompt ("type something!", "" );
  79. if (confirm("Are you sure you typed "+inputedData+"?")) {
  80. alert ("Ok, you did type "+inputedData+"!");
  81. }
  82. else {
  83. alert ("No, you did not type "+inputedData+", did you?  OK.  Guess ya did.");
  84.    }   
  85. }
  86. // End -->
  87. </SCRIPT>
  88.  
  89. <!-- STEP TWO: Put this code into the BODY of your HTML document  -->
  90.  
  91. <BODY>
  92.  
  93. <CENTER>
  94. <FORM>
  95. <input type=button value="Confirm (Alert)" onClick="askData()">
  96. </FORM>
  97. <!-- Or another method...  --><BR>Or....<BR>
  98. <A HREF="" onMouseover="askData()">Confirm & Alert</A>
  99. </CENTER>
  100.  
  101.  
  102.  
  103. <!-- END OF SCRIPT -->
  104. <!/PREVIEW>
  105.  
  106. <!RELATED>NONE<!/RELATED>
  107.